'use strict'

const fs = require('fs')

let stm = fs.createReadStream('./null.txt')

setTimeout(() => {
  stm.on('data', chunk => {
    console.log(chunk.length)
  })
}, 2000)

stm.on('end', () => {
  console.log('--end--')
})

stm.on('close', () => {
  console.log('--close--')
})

/* setTimeout(() => {
  stm.destroy()
}, 10)
 */